package com.ftd.controller;

import com.alibaba.fastjson.JSONArray;
import com.ftd.model.Index;
import com.ftd.model.Mark;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;

/**
 * Created by apple on 16/7/31.
 */
@Controller
@RequestMapping(value = "/hibook")
public class IndexViewController {
    @RequestMapping("getIndexJson.do")
    @ResponseBody
    public ArrayList getIndexJson(){
        Index index1= new Index("http://ac-EYUJxAnb.clouddn.com/f3c02482a450b1d1.jpg","http://ac-EYUJxAnb.clouddn.com/a1902bd9f807b67e.jpg");
        Index index2= new Index("http://ac-EYUJxAnb.clouddn.com/0c3c1360d80f6842.jpg","http://ac-EYUJxAnb.clouddn.com/db0c741c168cbc4f.jpg");
        Index index3= new Index("http://ac-EYUJxAnb.clouddn.com/089cade21da1c58a.jpg","http://ac-EYUJxAnb.clouddn.com/ccffe066c866685a.jpg");
        Index index4= new Index("http://ac-EYUJxAnb.clouddn.com/1fad5da744106b34.jpg","http://ac-EYUJxAnb.clouddn.com/8b1dd1a25d761d75.jpg");


        ArrayList markArray = new ArrayList();

        markArray.add(index1);
        markArray.add(index2);
        markArray.add(index3);
        markArray.add(index4);



//        markArray.add(0,"");

        JSONArray arr = new JSONArray();
        arr.addAll(markArray);

        return markArray;
    }
    @RequestMapping(value = "indexView")
    public String indexView(){
        return "indexView";
    }
}
